package com.dubbo.cp.provider;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.test.autoconfigure.orm.jpa.AutoConfigureDataJpa;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ImportResource;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

@SpringBootApplication
@ImportResource("classpath:provider.xml")
@ComponentScan(basePackages = "com.dubbo.cp.*")
@EntityScan(basePackages = "com.dubbo.cp.*")
@EnableJpaRepositories(basePackages = "com.dubbo.cp.*")
@AutoConfigureDataJpa
public class ProviderApplication {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		ConfigurableApplicationContext  context=SpringApplication.run(ProviderApplication.class, args);
		String s=context.getEnvironment().getProperty("dubbo.registry.address");
		System.out.println(s);
	}

}
